import http from '@/utils/http'

import {
	adviceResponse
} from './app.js';

export function getOrderList(param) {
	let acToken = uni.getStorageSync('userToken');
	http.config.header.Authorization = acToken;

	var config = http.post('/wx/order/getOrderList', param , {
		loadingText: false
	});

	return adviceResponse(config);
}

export function getOrderDetail(param) {
	let acToken = uni.getStorageSync('userToken');
	http.config.header.Authorization = acToken;

	var config = http.post('/wx/order/getOrderDetail', param , {
		loadingText: false
	});

	return adviceResponse(config);
}

export function addOrder(param) {
	let acToken = uni.getStorageSync('userToken');
	http.config.header.Authorization = acToken;

	var config = http.post('/wx/order/addOrder', param , {
		loadingText: false
	});

	return adviceResponse(config);
}

export function getAreaInfo() {
	let acToken = uni.getStorageSync('userToken');
	http.config.header.Authorization = acToken;

	var config = http.post('/wx/order/getAreaInfo', null , {
		loadingText: false
	});

	return adviceResponse(config);
}

export function getCommentList(para) {
	let acToken = uni.getStorageSync('userToken');
	http.config.header.Authorization = acToken;

	var config = http.post('/wx/order/getCommentList', para , {
		loadingText: false
	});

	return adviceResponse(config);
}

export function addComment(para) {
	let acToken = uni.getStorageSync('userToken');
	http.config.header.Authorization = acToken;

	var config = http.post('/wx/order/addComment', para , {
		loadingText: false
	});

	return adviceResponse(config);
}

export function addLike(para) {
	let acToken = uni.getStorageSync('userToken');
	http.config.header.Authorization = acToken;

	var config = http.post('/wx/order/addLike', para , {
		loadingText: false
	});

	return adviceResponse(config);
}

export function getOrderModel() {
	let acToken = uni.getStorageSync('userToken');
	http.config.header.Authorization = acToken;

	var config = http.post('/wx/order/getOrderModel', null , {
		loadingText: false
	});

	return adviceResponse(config);
}

export function addModelRecord(para) {
	let acToken = uni.getStorageSync('userToken');
	http.config.header.Authorization = acToken;

	var config = http.post('/wx/order/addModelRecord', para , {
		loadingText: false
	});

	return adviceResponse(config);
}

export function getMyOrderList(para) {
	let acToken = uni.getStorageSync('userToken');
	http.config.header.Authorization = acToken;

	var config = http.post('/wx/order/getMyOrderList', para , {
		loadingText: false
	});

	return adviceResponse(config);
}